<div class="inner-content box green" style="margin-top: 0px;">
    <div class="content">
        <h2 class="contentheading">
            <a class="contentpagetitle" href="<?php echo site_url($this->mycommon->convertToAlias($postInfo['title']) . '_' . $postInfo['id']) ?>">
                <?php echo $postInfo['title'] ?> <span> - <?php echo date('H:i:s d-m-Y', strtotime($postInfo['modified'])) ?></span>
            </a>
            <?php if ($postInfo['type'] == 1): ?>
                <p style="margin:0px;font-size:12px;padding-left:10px;padding-top:7px;">Giá bán : <span style="color:red"><?php echo number_format($postInfo['price'], 0, '.', '.') ?> đ/kg</span></p>
                <p style="margin:0px;font-size:12px;padding-left:10px;padding-top:7px;">ĐT liên hệ : <span style="color:red"><?php echo $postInfo['phone'] ?></span></p>
                
            <?php endif; ?>
        </h2>
        <div class="rating-post" style="margin-bottom: 5px">
            <p style="font-weight: bold;float:left;display: block;margin: 2px 15px">Bình chọn : </p>
            <div>
                <div class="jrating" style="float:left" id="<?php echo ($postInfo['count_vote'] != 0) ? $postInfo['vote'] / $postInfo['count_vote'] : 0 ?>_<?php echo $postInfo['id'] ?>"></div>
                <p style="float:left;margin:2px 7px;">Có <span style="font-weight:bold" class="jRating-Vote"><?php echo $postInfo['count_vote'] ?></span> lượt bình chọn</p>
            </div>
            <div class="clear"></div>
        </div>
        <div class="article-description">
            <?php echo $postInfo['description'] ?>
            <img src="<?php echo $this->mycommon->renderThumbImage($postInfo['link_img'], 400, 246) ?>" class="article-img" alt="<?php echo $postInfo['title'] ?>"/>
        </div>

        <div class="article-content"><?php echo $postInfo['content'] ?></div>
        <?php if (count($morePost) != 0): ?>
            <div class="more-article">
                <?php if ($postInfo['type'] == 1): ?>
                    <p>Các sản phẩm liên quan : </p>
                <?php else: ?>
                    <p>Các tin liên quan : </p>
                <?php endif; ?>
                <ul>
                    <?php foreach ($morePost as $p): ?>
                        <li><a href="<?php echo site_url($this->mycommon->convertToAlias($p['title']) . '_' . $p['id']) ?>"><?php echo $p['title'] ?></a><span> - <?php echo date('H:i:s d-m-Y', strtotime($p['modified'])) ?></span></li>
                    <?php endforeach; ?>
                </ul>
            </div>
        <?php endif; ?>
    </div>

    <script type="text/javascript">
        $(document).ready(function() {
            $(".jrating").jRating({
                bigStarsPath : base_url + 'images/default/stars.png',
                smallStarsPath : base_url + 'images/default/small.png',
<?php if (!$voted): ?>
                phpPath : '<?php echo site_url('post/vote') ?>',
<?php else: ?>
                isDisabled : true,
<?php endif; ?>
            type : 'big',
            length:5,
            decimalLength : 1,
            step:true,
            showRateInfo:false,
            onSuccess:function(element, rate, data) {
                $(".jRating-Vote").html(data.count);
                alert('Bạn đã bình chọn thành công, xin vui lòng cám ơn !');
            },
            onError:function(element, rate, data) {
                alert('Có lỗi xảy ra, xin vui lòng thực hiện lại!');
            }
        });
    });
    </script>
</div>